<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 单个勾选 -->
      <label> <input type="checkbox" v-model="isArgee" />同意该协议 </label>
      <h2>是否同意: {{isArgee ? "同意" : "不同意"}}</h2>
      <!-- : 是 v-bind的缩写 -->
      <button :disabled="!isArgee">下一步</button>

      <hr />
      <!-- 多个勾选 -->
      <label>兴趣爱好</label>
      <input type="checkbox" value="篮球" v-model="hobbies" />篮球
      <input type="checkbox" value="排球" v-model="hobbies" />排球
      <input type="checkbox" value="足球" v-model="hobbies" />足球
      <br>
      <h2>当前选择的爱好:{{hobbies}}</h2>
      <label v-for="item in stars" :for="item">
        <input type="checkbox" :value="item" v-model="likes"  >{{item}}
      </label>
      <h2>当前选择的明星为:{{likes}}</h2>
      <hr>

    </div>

    <script src="../js/vue.js"></script>

    <script>
      const app = Vue.createApp({
        data() {
          return {
            isArgee: false,
            hobbies: [], //爱好
            stars:['古力娜扎','迪丽热巴','甜多利娜'],
            likes:[],
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
